///////////////////////////////////////////////////////////
//  NewChoiceCommand.cpp
//  Implementation of the Class NewChoiceCommand
//  Created on:      21-Sep-2013 12:10:11 PM
//  Original author: Jakkaphan Aiemcharoenjit
///////////////////////////////////////////////////////////

#include "NewChoiceCommand.h"
#include "CurrentCommand.h"

using namespace UI;
using namespace UI::CMD;

NewChoiceCommand::NewChoiceCommand(CCreateChoiceView* createChoice, CCreateTemplateView* createTemplate)
{
  this->m_type = ICommand::NEWCHOICE_CMD;
  this->m_createChoiceView = createChoice;
  this->m_createTemplateView = createTemplate;
}


NewChoiceCommand::~NewChoiceCommand()
{

}


void NewChoiceCommand::Execute()
{
  IChoices* choices = this->m_createTemplateView->GetPage()->GetChoices();
  this->m_createChoiceView->SetChoices(choices);
  this->m_createChoiceView->Refresh();
  // Set current command
  CurrentCommand::GetInstance()->SetCurrentCommand(this->m_type);
}


ICommand::CommandType NewChoiceCommand::GetType()
{
	return this->m_type;
}